Skip to content

fix: recognize WebP image file extensions - #3484

Open
mahanpyk wants to merge 1 commit into
jonataslaw:masterfrom
mahanpyk:fix/webp-image-detection
Open

mahanpyk wants to merge 1 commit into
jonataslaw:masterfrom
mahanpyk:fix/webp-image-detection

Conversation

@mahanpyk

@mahanpyk mahanpyk commented Nov 1, 2026

Copy link
Copy Markdown

GetUtils.isImage('photo.webp') currently returns false, although WebP is an image format. Add .webp to the existing case-insensitive suffix checks; String.isImageFileName inherits the support through its existing delegation.

Add regression tests for all 16 capitalization combinations of webp, file names and paths, existing image formats, and strings without a supported final extension. Update the API documentation and English README with both public entry points.

Fixes #3430

Validation

Tested locally with Flutter 3.47.5 and Dart 3.13.4.

  • New WebP tests fail against the original implementation and pass with this change.
  • Focused utility and String extension tests: 55 passed.
  • Full suite: flutter test --reporter expanded — 228 passed.
  • Static analysis of the four changed Dart files: no issues found.
  • git diff --check: passed.
  • Full repository analysis reports one existing warning in the unchanged lib/get_connect/http/src/http.dart:235 (unawaited_return_in_try_block).

Pre-launch Checklist

  • Updated API documentation and the English README.
  • Added regression tests.
  • All existing and new tests pass (228 tests).

Coverage collection was attempted but stalled during test startup in this environment and was interrupted. The standard full suite completed successfully; no coverage percentage is claimed.

Add case-insensitive WebP support to GetUtils.isImage and String.isImageFileName. Cover capitalization, file paths, existing formats and unsupported suffixes with regression tests; document both public APIs.

Fixes jonataslaw#3430

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isImage

1 participant